package com.qf.sportsevent.entity;

import android.content.Context;
import android.content.Intent;
import android.databinding.ObservableInt;

import com.qf.sportsevent.activity.NewsDetailActivity;
import com.qf.sportsevent.activity.NewsSpecialActivity;

/**
 * Created by Administrator on 2016/12/15.
 */

public class NewsBannersEntity {
    private int id;
    private String image;
    private String title;
    private int type;
    private String link;
    private boolean video_flag;
    private boolean delete_flag;
    private ObservableInt currentPage=new ObservableInt(0);

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getLink() {
        return link;
    }

    public void setLink(String link) {
        this.link = link;
    }

    public boolean isVideo_flag() {
        return video_flag;
    }

    public void setVideo_flag(boolean video_flag) {
        this.video_flag = video_flag;
    }

    public boolean isDelete_flag() {
        return delete_flag;
    }

    public void setDelete_flag(boolean delete_flag) {
        this.delete_flag = delete_flag;
    }

    public void click(Context context){
        Intent intent;
        if(type==2) {
            intent=new Intent(context, NewsDetailActivity.class);
        }else if(type==4){
            intent=new Intent(context, NewsSpecialActivity.class);
        }else{
            return;
        }
        intent.putExtra("id",Integer.parseInt(link));
        context.startActivity(intent);
    }

    public ObservableInt getCurrentPage(){
        return currentPage;
    }
}
